package com.lam.system.listener;

import com.lam.common.components.easyexcel.imp.listener.BaseListener;
import com.lam.common.components.easyexcel.imp.model.ImportWrapper;
import com.lam.framework.bean.entity.SysDict;
import com.lam.system.entity.imp.SysDictImp;
import com.lam.system.service.SysDictService;

/**
 * 字典配置导入读取类 
 * 此类不能单例，要每次读取excel都要new 
 * @author admin
 *
 */
public class UploadSysDictListener extends BaseListener<SysDictImp, SysDict> {
	
	private SysDictService sysDictService;

	public UploadSysDictListener(SysDictService sysDictService) {
		super(SysDictImp.class, SysDict.class);
		this.sysDictService = sysDictService;
	}

	//重新该方法可自定义校验数据
//	@Override
//	protected String checkData(ImportEntry<SysDictImp, SysDict> wrapper) {
//		//自定义校验数据逻辑
//		return null;
//	}

	@Override
	protected void saveSuccessData(ImportWrapper<SysDictImp, SysDict> wrapper) {
		
		sysDictService.importData(wrapper);
	}


}
